import {observable, action} from 'mobx';

// 用于定义一些通用的变量方法，不需要可以不继承
export default class GlobalStore{
  @observable loading = false;
  
  @action openLoading = () => {
    this.loading = true;
    clearTimeout(this.loadingTimer);
    this.loadingTimer = setTimeout(() => {
      this.closeLoading();
    }, 6000);
  }

  @action closeLoading = () => {
    this.loading = false;
  }
}